home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-15 | 6.6 KB | 180 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- *
- * Apple Macintosh Developer Technical Support
- *
- * Installer 3.2 sample: User Functions
- *
- * File: UserFunction.r - Rez Source
- *
- * by: Jon Zap
- * updated for use with Installer 3.4 by: Rich Kubota 9/1/92
- *
- * Copyright © 1991 Apple Computer, Inc.
- * All rights reserved.
- *
- *------------------------------------------------------------------------------
- *
- * Install application "TheProgram" into the folder "Root":Installed Application.
- * It demonstrates both Easy and Custom Installation. For the Easy Installation
- * it checks for a specific nubus card and will not do the installation
- * if it is not there. Note that TheProgram can still be installed via a custom
- * installation if the user so chooses (to prevent this you need to preclude custom
- * installation).
- *----------------------------------------------------------------------------*/
-
- #include "Types.r" /* for the ICON resource */
- #include "InstallerTypes.r"
- #include "UserFunction.h" /* for the user function selectors */
-
- /* After you have created the UserFunction.rsrc file you can build and complete
- the script with the following lines:
- # Note: set up floppies with the appropriate names and contents before running scriptcheck
- # or set up folders with the same names and contents as the floppies
- # put these folders in the same folder as the script or at the root directory of same disk
-
- rez -o "UserFunction" -t 'bbkr' -c 'bbkr' "UserFunction.r"
- setfile -a i "UserFunction" #mark Inited
- scriptcheck -p "UserFunction"
- */
-
- /* Definition for the user function */
- #define UserFunctionID 1500
-
- /* bring the user function code resource into the installer doc... */
- INCLUDE "UserFunction.rsrc" 'infn' (1001) AS 'infn' (UserFunctionID, $$Attributes);
-
- /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
- #define kScriptCheckSetsDate 0x01
-
- /* Definitions for the rules */
- #define rlUserFun 1000
- #define rlMissingBoardError 1001
-
- /* Definitions for the file spec atoms (specifications for source and destination files) */
- #define fsSourceProgram 2000
- #define fsTargetProgram 2001
-
- /* This is the name of the source disk */
- #define ProgramDisk "Program Disk:"
-
- /* where we want to install our file. */
- #define TargetPath ":Installed Application:"
-
- /* Definition for the package. */
- #define pkTheProgram 3000
-
- /* Definition for the file atom */
- #define faProgram 4000
-
- /* Definition for the package comment resource */
- #define cmtTheProgram 5000
-
- /* September 1, 1992 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
- /* this value to a LongInt seconds value needed by the Installer. */
- #define currentReleaseDate 9011992
- #define currentVersion 0x101 /* Version 1.0.1 goes in the 'icmt' rsrc */
-
- #define iconTheProgram 5100
-
- /************************** Easy Install Rule resources **********************************/
- resource 'infr' (1) {
- format0 {{
- pickFirst, {rlUserFun, rlMissingBoardError}, /* Select only one of these rules */
- }};
- };
-
- resource 'inrl' (rlUserFun) {
- format0 {{
- /* If the system has my board, then add the package */
- checkUserFunction {UserFunctionType, UserFunctionID, FindMyBoard},
- addUserDescription {"Click Install button to install\n"}, /* message to appear in Easy Install screen */
- addUserDescription {"• TeachText\n"}, /* message to appear in Easy Install screen */
- addPackages {{pkTheProgram}} /* we're installing the program */
- }};
- };
-
- resource 'inrl' (rlMissingBoardError) {
- format0 {{
- /* This error message will be displayed on the Easy Install screen if this rule */
- /* fires. It fires if the first rule in this pickFirst group does not fire */
-
- reportSysError {"To do the installation you need:\n\n"},
- reportSysError {"• My cool nubus card\n"}
- }};
- };
-
- /***************************** Package Resources ************************************************/
- resource 'inpk' (pkTheProgram) {
- format0 {
- ShowsOnCustom, /* Package appears in the Custom Install display */
- Removable, /* Package can be removed */
- dontForceRestart, /* no need to restart */
- cmtTheProgram, /* package's 'icmt' resource id */
- 0, /* Package size (filled in by ScriptCheck) */
- "TheProgram", { /* package name for package that shows on custom */
- 'infa', faProgram;
- }
- }
- };
-
- /***************************** Comments ************************************************/
- resource 'icmt' (cmtTheProgram) {
- currentReleaseDate,
- currentVersion,
- iconTheProgram,
- "This package contains TheProgram. "
- };
-
- resource 'ICON' (iconTheProgram) {
- $"0430 4000 0A50 A000 0B91 1002 0822 0803"
- $"1224 0405 2028 0209 4010 0111 800C 00A1"
- $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
- $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
- $"0487 FE04 0288 0104 0188 0084 0088 0044"
- $"0088 0044 0088 00C4 0110 0188 0228 0310"
- $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
- $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
- };
-
-
- /********************************************* File Specs ******************************************/
- /* Source File Specs */
- resource 'infs' (fsSourceProgram) {
- 'APPL', /* File Type */
- 'ttxt', /* Creator */
- kScriptCheckSetsDate, /* ScriptCheck fills in the creation date */
- noSearchForFile, /* Do not search the source disk for the file */
- TypeCrMustMatch, /* file type and creator on source disk must match */
- ProgramDisk"TeachText" /* Path to the file */
- };
-
- /* Target File Specs */
- resource 'infs' (fsTargetProgram) {
- 'APPL', /* File Type */
- 'ttxt', /* Creator */
- 0, /* creation date not needed for target file specs */
- noSearchForFile, /* Do not search the target disk for the file */
- TypeCrMustMatch, /* not needed for target file specs */
- TargetPath"TeachText" /* destination Path */
- };
-
- /******************************************** File Atoms ************************************************/
- resource 'infa' (faProgram) {
- format0 {
- delRemove, /* Delete the file if remove (option-custom) is clicked */
- delInstall, /* Delete the target before copying new one */
- copy, /* Copy the file to the destination */
- leaveAloneIfNewer, /* do not Install this version, if newer one exists */
- noKeepExisting, /* Always replace an existing copy */
- copyIfNewOrUpdate, /* Copy whether the target file exists or not */
- rsrcFork, dataFork, /* Copy both forks of the file */
- fsTargetProgram, /* TARGET file spec for this file */
- fsSourceProgram, /* SOURCE file spec for this file */
- 0, /* atom size (filled in by ScriptCheck) */
- "" /* Atom Description (Installer will use file name) */
- };
- };
-
-
-
-